package com.neuedu.weishi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Repository;

import com.neuedu.weishi.entity.VideoCommentReply;
import com.neuedu.weishi.mapper.VideoCommentReplyMapper;
import com.neuedu.weishi.service.IVideoCommentReplyService;

import java.util.List;

@Service("videoCommentReplyService")
public class VideoCommentReplyServiceImpl implements IVideoCommentReplyService {

    @Autowired
    @Qualifier("videoCommentReplyMapper")
    private VideoCommentReplyMapper videoCommentReplyMapper;

    @Override
    public List<VideoCommentReply> selectList(VideoCommentReply videoCommentReply){
        QueryWrapper<VideoCommentReply> queryWrapper = new QueryWrapper<>();
        return videoCommentReplyMapper.selectList(queryWrapper);
    }

    @Override
    public IPage<VideoCommentReply> selectPage(IPage<VideoCommentReply> page){
        QueryWrapper<VideoCommentReply> queryWrapper = new QueryWrapper<>();
        return videoCommentReplyMapper.selectPage(page, queryWrapper);
    }

    @Override
    public VideoCommentReply selectById(Integer replyId) {
        return videoCommentReplyMapper.selectById(replyId);
    }

    @Override
    public int deleteById(Integer replyId) {
        return videoCommentReplyMapper.deleteById(replyId);
    }

    @Override
    public int delete(VideoCommentReply videoCommentReply){
        QueryWrapper<VideoCommentReply> queryWrapper = new QueryWrapper<>();
        return videoCommentReplyMapper.delete(queryWrapper);
    }

    @Override
    public int insert(VideoCommentReply videoCommentReply) {
        return videoCommentReplyMapper.insert( videoCommentReply);
    }

    @Override
    public int updateById(VideoCommentReply videoCommentReply) {
        return videoCommentReplyMapper.updateById(videoCommentReply);
    }

    @Override
    public int update(VideoCommentReply videoCommentReply) {
        UpdateWrapper<VideoCommentReply> updateWrapper = new UpdateWrapper<>();
        return videoCommentReplyMapper.update(videoCommentReply,updateWrapper);
    }
}